#pragma once

#include "ADMaterial.h"

// Forward Declarations
class SinglePyrolysisSolidADMaterial : public ADMaterial
{
public:
	static InputParameters validParams();

	SinglePyrolysisSolidADMaterial(const InputParameters& parameters);

protected:
	virtual void computeQpProperties();
	virtual void initQpStatefulProperties();
	Real PyrolysisSource(Real rho, Real T, Real T_begin, Real rhoc, Real rhov, Real precoff, Real ER, Real reaction_level);
private:
	//compute rho
	

	ADMaterialProperty<Real>& _rhos;
	ADMaterialProperty<Real>& _drhos_dt;
	ADMaterialProperty<Real>& _pyrolysis_source;
	ADMaterialProperty<Real>& _rhov;
	ADMaterialProperty<Real>& _rhoc;
	//compute char_percent
	ADMaterialProperty<Real>& _char_percent;
	//compute thermal comductivity
	ADMaterialProperty<Real>& _thermal_conductivity_v;
	ADMaterialProperty<Real>& _thermal_conductivity_c;
	ADMaterialProperty<Real>& _thermal_conductivity_s;
	//compute thermal comductivity
	ADMaterialProperty<Real>& _specific_heat_v;
	ADMaterialProperty<Real>& _specific_heat_c;
	ADMaterialProperty<Real>& _specific_heat_s;
	//compute porous property
	ADMaterialProperty<Real>& _porosity_v;
	ADMaterialProperty<Real>& _porosity_c;
	ADMaterialProperty<Real>& _porosity;
	ADMaterialProperty<Real>& _permeability_v;
	ADMaterialProperty<Real>& _permeability_c;
	ADMaterialProperty<Real>& _permeability;
	//compute pyrolysis heat
	ADMaterialProperty<Real>& _pyrolysis_heat;
	//compute surface emissivity
	MaterialProperty<Real>& _surface_emissivity;
	//get pyrolysis values
	Real  _rhov_value;
	Real  _rhoc_value;
	Real  _T_begin_value;
	Real  _precoff_value;
	Real  _ER_value;
	Real  _reaction_level_value;
	//get thermal conductivity values
	std::vector<Real>  _kvT_list; //to get T list of thermal_conductivity_v
	std::vector<Real>  _kv_list; //to get list of thermal_conductivity_v
	std::vector<Real>  _kcT_list;//to get T list of thermal_conductivity_c
	std::vector<Real>  _kc_list;//to get list of thermal_conductivity_v
//get specific heat values
	std::vector<Real>  _cpvT_list;//to get T list of cpv
	std::vector<Real>  _cpv_list;//to get list of cpv
	std::vector<Real>  _cpcT_list;//to get T list of cpc
	std::vector<Real>  _cpc_list;//to get list of cpc
// LinearInterpolation functions
	LinearInterpolation  _func_kv_T;
	LinearInterpolation  _func_kc_T;
	LinearInterpolation  _func_cpv_T;
	LinearInterpolation  _func_cpc_T;
	//get porous media parameters
	Real  _porosity_v_value;
	Real  _porosity_c_value;
	Real  _permeability_v_value;
	Real  _permeability_c_value;
	//get pyrolysis heat
	Real  _pyrolysis_heat_value;
	// get surface emissivity
	Real  _surface_emissivity_value;
	//get values
	const MaterialProperty<Real>& _rhos_old;
	const VariableValue& _temperature;
//	const VariableValue& _rhos_value;

};